﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace YourMoney
{
    /// <summary>
    /// Тип Сущности
    /// </summary>
   public class TypeOfEssence:TreeNode
    {
        private int kindId;

        public int KindId
        {
            get { return kindId; }
            set { kindId = value; }
        }
        private int id;
        private int isRoot;

        public int IsRoot
        {
            get { return isRoot; }
            set { isRoot = value; }
        }
        private int parentId;
        private string name;
        private int color;
        /// <summary>
        /// ID типа
        /// </summary>
        public int ID
        {
            get { return id; }
            set { id = value; }
        }
        /// <summary>
        /// ID родительского типа
        /// </summary>
        public int ParentID
        {
            get { return parentId; }
            set { parentId = value; }
        }
        /// <summary>
        /// Имя типа
        /// </summary>
        public  string Name
        {
            get { return name; }
            set { name = value; }
        }
        /// <summary>
        /// Цвет
        /// </summary>
        public int Color
        {
            get { return color; }
            set { color = value; }
        }
        /// <summary>
        /// Конструктор для создания типа
        /// </summary>
        /// <param name="id">ID типа</param>
        /// <param name="parentId">ID родительского типа</param>
        /// <param name="kindId"></param>
        /// <param name="isRoot">Корень</param>
        /// <param name="name">Имя</param>
        /// <param name="color">Цвет</param>
        public TypeOfEssence(int id, int parentId, int kindId,int isRoot, string name, int color)
        {
            this.isRoot = isRoot;
            this.kindId = kindId;
            this.id = id;
            this.parentId = parentId;
            this.name = name;
            this.color = color;
        }
        public TypeOfEssence(int parentId, int kindId, int isRoot, string name, int color)
        {
            this.isRoot = isRoot;
            this.kindId = kindId;
            this.parentId = parentId;
            this.name = name;
            this.color = color;
        }
        public TypeOfEssence(int id, string name) 
        {
            this.id = id;
            this.name = name;
        }
        public override string ToString()
        {
            return this.name;
        }
    }
}
